import request from '@/utils/request'

// 获取组件架构列表
export const departmentListApi = () => (
  request.get('/company/department')
)

// 获取部门负责人列表
export const getEmployeeSimpleApi = () => (
  request.get('/sys/user/simple')
)

// 新增子部门接口
// data ： name, code, manager, introduce, pid
// data ： 部门名称, 部门编码, 部门管理者, 部门介绍, 新增的这个子部门的上级部门
export const addDepartmentsApi = (data) => {
  return request.post('/company/department',data)
}

// 获取部门详情
export const getDepartDetailApi = (id) => (
  request.get(`/company/department/${id}`)
)

// 更新部门详情  data: form表单数据 但是要有id, 父级的频道id
export const updateDepartApi = (data) => (
  request.put(`/company/department/${data.id}`, data)
)


// 删除部门
export const deleteDepartApi = (id) => (
  request.delete(`/company/department/${id}`)
)